package com.martian.common.exception;

import com.martian.common.enums.UserErrorCodeEnum;

/**
 * @author martian
 * @version V1.0.0
 * @Description
 * @date 2023-03-24 14:08
 */

public class UserException extends SysException {
    protected int code;
    public UserException(){}
    public UserException(String message){super(message);}
    //Object ...args java某个版本的新特性
    public UserException(UserErrorCodeEnum codeEnum, Object... args){
        super(String.format(codeEnum.getMessage(), args));
        this.code = codeEnum.getCode();
    }
}
